package com.itfreer.power.dao.organize;

import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;

import org.springframework.beans.BeanUtils;

import com.itfreer.form.api.JdbcBaseEntity;
import com.itfreer.power.dao.base.JdbcTreeEntityBase;
import com.itfreer.power.entity.organize.AdministrativeEntity;

/**
 * jdbc政区
 */
@Entity(name = "sso_organize_administrative")
@Table(indexes = { 
        @Index(name="sso_administrative_code", columnList="s_code"),
        @Index(name="sso_administrative_pid", columnList="pid") })
public class JdbcAdministrativeEntity extends JdbcTreeEntityBase implements JdbcBaseEntity<AdministrativeEntity> {

	private static final long serialVersionUID = -5869202233794755528L;

	@Override
	public void from(AdministrativeEntity t) {
		BeanUtils.copyProperties(t, this);
	}

	@Override
	public AdministrativeEntity toEntity() {
		AdministrativeEntity toEntity = new AdministrativeEntity();
		BeanUtils.copyProperties(this, toEntity);
		return toEntity;
	}
}